package edu.im.main;

import java.net.ServerSocket;
import java.net.Socket;

/**
 * Echo server for testing the java client
 * @author robbiediaz
 */
public class TestServer {

    public static void main(String[] args) throws Exception {
        ServerSocket sock = new ServerSocket(5222);
        
        byte[] buffer = new byte[1000];

        Socket client = sock.accept();

        while (true) {
            client.getInputStream().read(buffer);

            System.out.println(new String(buffer));

            client.getOutputStream().write(buffer);
        }
    }
}
